import Vue from 'vue'
import App from './App.vue'
import router from "./router"
import TypeNav from "./components/TypeNav";
import store from "@/store"
import "@/mock/mockServer"
import "swiper/css/swiper.min.css"
import Pagination from "@/components/Pagination"
import Carousel from "@/components/Carousel"
//引入api中的接口，当项目不使用vuex时，使用该方法
import * as API from "@/api"
//按需引入element-ui 
import { MessageBox } from "element-ui"
//引入懒加载插件
import VueLazyload from 'vue-lazyload'
import ZhanYing from "@/assets/1.gif"
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
Vue.component("TypeNav", TypeNav);
Vue.component("Pagination", Pagination);
Vue.config.productionTip = false
Vue.use(VueLazyload, {
  loading: ZhanYing
})
Vue.component("Carousel", Carousel);
new Vue({
  el: "#app",
  render: h => h(App),
  router,
  store,
  beforeMount() {
    Vue.prototype.$bus = this;
    //安装全局API，让组件可以使用
    Vue.prototype.$API = API
  }
})
